#pragma once

#include <vector>

template <typename T>
struct Sound
{
    typedef T type;
    typedef std::vector<type> channel_data;
    typedef std::vector<channel_data> raw_data;

    int _hz;
    raw_data _pcm;

    Sound() : _hz(0){}

    int channels() const { return _pcm.size(); }

    int length() const { return channels() == 0 ? 0 : _pcm[0].size(); }

    type operator()(unsigned int channel, unsigned int index) const { return _pcm[channel][index]; }
};

template <typename T>
class Decoder
{
public:
    virtual bool decode(const std::string& filename, Sound<T>& sound) = 0;
};
